package com.timeDeal.servlet;







import com.timeDeal.bean.GuanliyuanBean;
import com.timeDeal.service.AdminService;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


/**
 * Created by Administrator on 2016/7/24.
 */

public class LayoutServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       String flag = request.getParameter("flag");
       if(StringUtils.equals("1",flag)){
            request.getSession().removeAttribute("USER");
           request.getRequestDispatcher("/user/zhujiemiangg.jsp").forward(request,response);
       }
        else{
           request.getSession().removeAttribute("ADMIN");
           request.getRequestDispatcher("/admin/login.jsp").forward(request,response);
       }
    }
}
